import {
  IsArray,
  IsJSON,
  IsNumber,
  IsOptional,
  IsString,
  Length,
} from 'class-validator';
import { ApiProperty } from '@nestjs/swagger';

export class FindAllUserDto {
  @ApiProperty({
    description: '用户id',
    required: false,
  })
  @IsOptional()
  @IsNumber()
  user_id?: number;

  @ApiProperty({
    description: '用户名',
    required: false,
  })
  @IsOptional()
  @IsString()
  username?: string;

  @ApiProperty({
    description: '昵称',
    required: false,
  })
  @IsOptional()
  @IsString()
  nickname?: string;

  @ApiProperty({
    description: '手机号',
    required: false,
  })
  @IsOptional()
  @IsString()
  phone?: number;

  @ApiProperty({
    description: '创建时间',
    required: false,
  })
  @IsOptional()
  @IsArray()
  create_time?: string[];

  @ApiProperty({
    description: '修改时间',
    required: false,
  })
  @IsOptional()
  @IsArray()
  update_time?: string[];

  @ApiProperty({
    description: '每页限制条数',
    required: false,
    default: 10,
  })
  @IsOptional()
  limit?: number;

  @ApiProperty({
    description: '当前页',
    required: false,
    default: 1,
  })
  @IsOptional()
  page?: number;
}
